<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Introduction - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/zend.locale.introduction.html">Inglês (English)</a></li>
    <li><a href="../pt-br/zend.locale.introduction.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.locale.html">Zend_Locale</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.locale.html">Zend_Locale</a></span><br />
                        <span class="home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.locale.functions.html">Using Zend_Locale</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="zend.locale.introduction" class="section"><div class="info"><h1 class="title">Introduction</h1></div>
    

    <p class="para">
        <span class="classname">Zend_Locale</span> is the Frameworks answer to the question, &quot;How can the
        same application be used around the whole world?&quot; Most people will say, &quot;That&#039;s easy. Let&#039;s
        translate all our output to several languages.&quot; However, using simple translation tables to
        map phrases from one language to another is not sufficient. Different regions will have
        different conventions for first names, surnames, salutory titles, formatting of numbers,
        dates, times, currencies, etc.
    </p>

    <p class="para">
        We need <a href="http://en.wikipedia.org/wiki/Internationalization_and_localization" class="link external">&raquo; Localization
            and complementary Internationalization</a>. Both are often abbreviated to
        <em class="emphasis">L10n</em> and <em class="emphasis">I18n</em>. Internationalization
        refers more to support for use of systems, regardless of special needs unique to groups of
        users related by language, region, number format conventions, financial conventions, time
        and date conventions, etc. Localization involves adding explicit support to systems for
        special needs of these unique groups, such as language translation, and support for local
        customs or conventions for communicating plurals, dates, times, currencies, names, symbols,
        sorting and ordering, etc. <em class="emphasis">L10n</em> and <em class="emphasis">I18n</em>
        compliment each other. Zend Framework provides support for these through a combination of
        components, including <span class="classname">Zend_Locale</span>, <span class="classname">Zend_Date</span>,
        <span class="classname">Zend_Measure</span>, <span class="classname">Zend_Translate</span>,
        <span class="classname">Zend_Currency</span>, and <span class="classname">Zend_TimeSync</span>.
    </p>

    <div class="tip"><b class="tip">Tip</b><div class="info"><h1 class="title">Zend_Locale and setLocale()</h1></div>
        

        <p class="para">
            <a href="http://php.net/setlocale" class="link external">&raquo; PHP&#039;s documentation</a> states that
             <span class="methodname">setlocale()</span> is not threadsave because it is maintained per
            process and not per thread. This means that, in multithreaded environments, you can have
            the problem that the locale changes while the script never has changed the locale
            itself. This can lead to unexpected behaviour when you use
             <span class="methodname">setlocale()</span> in your scripts.
        </p>

        <p class="para">
            When you are using <span class="classname">Zend_Locale</span> you will not have this
            limitations, because <span class="classname">Zend_Locale</span> is not related to or coupled
            with <acronym class="acronym">PHP</acronym>&#039;s  <span class="methodname">setlocale()</span>.
        </p>
    </div>

    <div class="section" id="zend.locale.whatislocalization"><div class="info"><h1 class="title">What is Localization</h1></div>
        

        <p class="para">
            Localization means that an application (or homepage) can be used from different users
            which speak different languages. But as you already have expected Localization means
            more than only translating strings. It includes
        </p>

        <ul class="itemizedlist">
            <li class="listitem">
                <p class="para">
                    <span class="classname">Zend_Locale</span> - Backend support of locales available for
                    localization support within other Zend Framework components.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="classname">Zend_Translate</span> - Translating of strings.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="classname">Zend_Date</span> - Localization of dates, times.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="classname">Zend_Calendar</span> - Localization of calendars (support for
                    non-Gregorian calendar systems)
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="classname">Zend_Currency</span> - Localization of currencies.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="classname">Zend_Locale_Format</span> - Parsing and generating localized
                    numbers.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="classname">Zend_Locale_Data</span> - Retrieve localized standard strings
                    as country names, language names and <a href="http://unicode.org/cldr/" class="link external">&raquo; more from the
                        <acronym class="acronym">CLDR</acronym></a>.
                </p>
            </li>
        </ul>
    </div>

    <div class="section" id="zend.locale.whatis"><div class="info"><h1 class="title">What is a Locale?</h1></div>
        

        <p class="para">
            Each computer user makes use of Locales, even when they don&#039;t know it. Applications
            lacking localization support, normally have implicit support for one particular locale
            (the locale of the author). When a class or function makes use of localization, we say
            it is <em class="emphasis">locale-aware</em>. How does the code know which localization the
            user is expecting?
        </p>

        <p class="para">
            A locale string or object identifying a supported locale gives
            <span class="classname">Zend_Locale</span> and its subclasses access to information about the
            language and region expected by the user. Correct formatting, normalization, and
            conversions are made based on this information.
        </p>
    </div>

    <div class="section" id="zend.locale.representation"><div class="info"><h1 class="title">How are Locales Represented?</h1></div>
        

        <p class="para">
            Locale identifiers consist of information about the user&#039;s language and
            preferred/primary geographic region (e.g. state or province of home or workplace). The
            locale identifier strings used in Zend Framework are internationally defined standard
            abbreviations of language and region, written as <em class="emphasis">language_REGION</em>.
            Both the language and region parts are abbreviated to alphabetic,
            <acronym class="acronym">ASCII</acronym> characters.
        </p>

        <blockquote class="note"><p><b class="note">Note</b>: 
            <p class="para">
                Be aware that there exist not only locales with 2 characters as most people think.
                Also there are languages and regions which are not only abbreviated with 2
                characters. Therefor you should NOT strip the region and language yourself, but use
                <span class="classname">Zend_Locale</span> when you want to strip language or region from a
                locale string. Otherwise you could have unexpected behaviour within your code when
                you do this yourself.
            </p>
        </p></blockquote>

        <p class="para">
            A user from USA would expect the language English and the region
            <b><tt>USA</tt></b>, yielding the locale identifier &quot;en_US&quot;. A user in Germany
            would expect the language German and the region Germany,
            yielding the locale identifier &quot;de_DE&quot;. See the <a href="http://unicode.org/cldr/data/diff/supplemental/languages_and_territories.html" class="link external">&raquo; list
                of pre-defined locale and region combinations</a>, if you need to select a
            specific locale within Zend Framework.
        </p>

        <div class="example" id="zend.locale.representation.example-1"><div class="info"><p><b>Example #1 Choosing a specific locale</b></p></div>
            

            <pre class="programlisting brush: php">
$locale = new Zend_Locale(&#039;de_DE&#039;); // German language _ Germany
</pre>

        </div>

        <p class="para">
            A German user in America might expect the language German and the region
            <b><tt>USA</tt></b>, but these non-standard mixes are not supported directly as
            recognized &quot;locales&quot;. Instead, if an invalid combination is used, then it will
            automatically be truncated by dropping the region code. For example, &quot;de_IS&quot; would be
            truncated to &quot;de&quot;, and &quot;xh_RU&quot; would be truncated to &quot;xh&quot;, because neither of these
            combinations are valid. Additionally, if the base language code is not supported (e.g.
            &quot;zz_US&quot;) or does not exist, then a default &quot;root&quot; locale will be used. The &quot;root&quot; locale
            has default definitions for internationally recognized representations of dates, times,
            numbers, currencies, etc. The truncation process depends on the requested information,
            since some combinations of language and region might be valid for one type of data (e.g.
            dates), but not for another (e.g. currency format).
        </p>

        <p class="para">
            Beware of historical changes, as Zend Framework components do not know about or attempt
            to track the numerous timezone changes made over many years by many regions. For
            example, <a href="http://www.statoids.com/tus.html" class="link external">&raquo; we can see a historical
                list</a> showing dozens of changes made by governments to when and if a
            particular region observes Daylight Savings Time, and even which timezone a particular
            geographic area belongs. Thus, when performing date math, the math performed by Zend
            Framework components will not adjust for these changes, but instead will give the
            correct time for the timezone using current, modern rules for <acronym class="acronym">DST</acronym> and
            timezone assignment for geographic regions.
        </p>
    </div>

    <div class="section" id="zend.locale.selection"><div class="info"><h1 class="title">Selecting the Right Locale</h1></div>
        

        <p class="para">
            For most situations, <strong class="command">new Zend_Locale()</strong> will automatically select the
            correct locale, with preference given to information provided by the user&#039;s web browser.
            However, if <strong class="command">new Zend_Locale(Zend_Locale::ENVIRONMENT)</strong> is used, then
            preference will be given to using the host server&#039;s environment configuration, as
            described below.
        </p>

        <div class="example" id="zend.locale.selection.example-1"><div class="info"><p><b>Example #2 Automatically selecting a locale</b></p></div>
            

            <pre class="programlisting brush: php">
$locale  = new Zend_Locale();

// default behavior, same as above
$locale1 = new Zend_Locale(Zend_Locale::BROWSER);

// prefer settings on host server
$locale2 = new Zend_Locale(Zend_Locale::ENVIRONMENT);

// perfer framework app default settings
$locale3 = new Zend_Locale(Zend_Locale::FRAMEWORK);
</pre>

        </div>

        <p class="para">
            The search algorithm used by <span class="classname">Zend_Locale</span> for automatic selection
            of a locale uses three sources of information:

            <ol type="1">
                <li class="listitem">
                    <p class="para">
                        const <b><tt>Zend_Locale::BROWSER</tt></b> - The user&#039;s Web browser
                        provides information with each request, which is published by
                        <acronym class="acronym">PHP</acronym> in the global variable
                        <var class="varname">$_SERVER[&#039;HTTP_ACCEPT_LANGUAGE&#039;]</var>. if no matching locale
                        can be found, then preference is given to <b><tt>ENVIRONMENT</tt></b>
                        and lastly <b><tt>FRAMEWORK</tt></b>.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        const <b><tt>Zend_Locale::ENVIRONMENT</tt></b> - <acronym class="acronym">PHP</acronym>
                        publishes the host server&#039;s locale via the <acronym class="acronym">PHP</acronym> internal
                        function  <span class="methodname">setlocale()</span>. If no matching locale can be
                        found, then preference is given to <b><tt>FRAMEWORK</tt></b> and lastly
                        <b><tt>BROWSER</tt></b>.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        const <b><tt>Zend_Locale::FRAMEWORK</tt></b> - When Zend Framework has
                        a standardized way of specifying component defaults (planned, but not yet
                        available), then using this constant during instantiation will give
                        preference to choosing a locale based on these defaults. If no matching
                        locale can be found, then preference is given to
                        <b><tt>ENVIRONMENT</tt></b> and lastly <b><tt>BROWSER</tt></b>.
                    </p>
                </li>
            </ol>
        </p>
    </div>

    <div class="section" id="zend.locale.selection.automatic"><div class="info"><h1 class="title">Usage of automatic Locales</h1></div>
        

        <p class="para">
            <span class="classname">Zend_Locale</span> provides three additional locales. These locales do
            not belong to any language or region. They are &quot;automatic&quot; locales which means that they
            have the same effect as the method  <span class="methodname">getDefault()</span> but without the
            negative effects like creating an instance. These &quot;automatic&quot; locales can be used
            anywhere, where also a standard locale and also the definition of a locale, its string
            representation, can be used. This offers simplicity for situations like working with
            locales which are provided by a browser.
        </p>

        <p class="para">
            There are three locales which have a slightly different behaviour:

            <ol type="1">
                <li class="listitem">
                    <p class="para">
                        &#039;<span class="property">browser</span>&#039; - <span class="classname">Zend_Locale</span> should
                        work with the information which is provided by the user&#039;s Web browser. It
                        is published by <acronym class="acronym">PHP</acronym> in the global variable
                        <b><tt>$_SERVER[&#039;HTTP_ACCEPT_LANGUAGE&#039;]</tt></b>.
                    </p>

                    <p class="para">
                        If a user provides more than one locale within his browser,
                        <span class="classname">Zend_Locale</span> will use the first found locale. If the
                        user does not provide a locale or the script is being called from the
                        command line the automatic locale &#039;<span class="property">environment</span>&#039; will
                        automatically be used and returned.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        &#039;<span class="property">environment</span>&#039; - <span class="classname">Zend_Locale</span>
                        should work with the information which is provided by the host server. It
                        is published by <acronym class="acronym">PHP</acronym> via the internal function
                         <span class="methodname">setlocale()</span>.
                    </p>

                    <p class="para">
                        If a environment provides more than one locale,
                        <span class="classname">Zend_Locale</span> will use the first found locale. If the
                        host does not provide a locale the automatic locale
                        &#039;<span class="property">browser</span>&#039; will automatically be used and returned.
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        &#039;<span class="property">auto</span>&#039; - <span class="classname">Zend_Locale</span> should
                        automatically detect any locale which can be worked with. It will first
                        search for a users locale and then, if not successful, search for the host
                        locale.
                    </p>

                    <p class="para">
                        If no locale can be detected, it will throw an exception and tell you that
                        the automatic detection has been failed.
                    </p>
                </li>
            </ol>
        </p>

        <div class="example" id="zend.locale.selection.automatic.example-1"><div class="info"><p><b>Example #3 Using automatic locales</b></p></div>
            

            <pre class="programlisting brush: php">
// without automatic detection
//$locale = new Zend_Locale(Zend_Locale::BROWSER);
//$date = new Zend_Date($locale);

// with automatic detection
$date = new Zend_Date(&#039;auto&#039;);
</pre>

        </div>
    </div>

    <div class="section" id="zend.locale.defaultlocale"><div class="info"><h1 class="title">Using a default Locale</h1></div>
        

        <p class="para">
            In some environments it is not possible to detect a locale automatically. You can expect
            this behaviour when you get an request from command line or the requesting browser has
            no language tag set and additionally your server has the default locale &#039;C&#039; set or
            another proprietary locale.
        </p>

        <p class="para">
            In such cases <span class="classname">Zend_Locale</span> will normally throw an exception with a
            message that the automatic detection of any locale was not successful. You have two
            options to handle such a situation. Either through setting a new locale per hand, or
            defining a default locale.
        </p>

        <div class="example" id="zend.locale.defaultlocale.example-1"><div class="info"><p><b>Example #4 Handling locale exceptions</b></p></div>
            

            <pre class="programlisting brush: php">
// within the bootstrap file
try {
    $locale = new Zend_Locale(&#039;auto&#039;);
} catch (Zend_Locale_Exception $e) {
    $locale = new Zend_Locale(&#039;de&#039;);
}

// within your model/controller
$date = new Zend_Date($locale);
</pre>

        </div>

        <p class="para">
            But this has one big negative effect. You will have to set your locale object within
            every class using <span class="classname">Zend_Locale</span>. This could become very unhandy if
            you are using multiple classes.
        </p>

        <p class="para">
            Since Zend Framework Release 1.5 there is a much better way to handle this. You can set
            a default locale which the static  <span class="methodname">setDefault()</span> method. Of
            course, every unknown or not fully qualified locale will also throw an exception.
             <span class="methodname">setDefault()</span> should be the first call before you initiate any
            class using <span class="classname">Zend_Locale</span>. See the following example for details:
        </p>

        <div class="example" id="zend.locale.defaultlocale.example-2"><div class="info"><p><b>Example #5 Setting a default locale</b></p></div>
            

            <pre class="programlisting brush: php">
// within the bootstrap file
Zend_Locale::setDefault(&#039;de&#039;);

// within your model/controller
$date = new Zend_Date();
</pre>

        </div>

        <p class="para">
            In the case that no locale can be detected, automatically the locale
            <em class="emphasis">de</em> will be used. Otherwise, the detected locale will be used.
        </p>
    </div>

    <div class="section" id="zend.locale.interoperate"><div class="info"><h1 class="title">ZF Locale-Aware Classes</h1></div>
        

        <p class="para">
            In the Zend Framework, locale-aware classes rely on <span class="classname">Zend_Locale</span>
            to automatically select a locale, as explained above. For example, in a Zend Framework
            web application, constructing a date using <span class="classname">Zend_Date</span> without
            specifying a locale results in an object with a locale based on information provided by
            the current user&#039;s web browser.
        </p>

        <div class="example" id="zend.locale.interoperate.example-1"><div class="info"><p><b>Example #6 Dates default to correct locale of web users</b></p></div>
            

            <pre class="programlisting brush: php">
$date = new Zend_Date(&#039;2006&#039;,Zend_Date::YEAR);
</pre>

        </div>

        <p class="para">
            To override this default behavior, and force locale-aware Zend Framework components to
            use specific locales, regardless of the origin of your website visitors, explicitly
            specify a locale as the third argument to the constructor.
        </p>

        <div class="example" id="zend.locale.interoperate.example-2"><div class="info"><p><b>Example #7 Overriding default locale selection</b></p></div>
            

            <pre class="programlisting brush: php">
$usLocale = new Zend_Locale(&#039;en_US&#039;);
$date = new Zend_Date(&#039;2006&#039;, Zend_Date::YEAR, $usLocale);
$temp = new Zend_Measure_Temperature(&#039;100,10&#039;,
                                     Zend_Measure::TEMPERATURE,
                                     $usLocale);
</pre>

        </div>

        <p class="para">
            If you know many objects should all use the same default locale, explicitly specify the
            default locale to avoid the overhead of each object determining the default locale.
        </p>

        <div class="example" id="zend.locale.interoperate.example-3"><div class="info"><p><b>Example #8 Performance optimization when using a default locale</b></p></div>
            

            <pre class="programlisting brush: php">
$locale = new Zend_Locale();
$date = new Zend_Date(&#039;2006&#039;, Zend_Date::YEAR, $locale);
$temp = new Zend_Measure_Temperature(&#039;100,10&#039;,
                                     Zend_Measure::TEMPERATURE,
                                     $locale);
</pre>

        </div>
    </div>

    <div class="section" id="zend.locale.frameworkwidelocale"><div class="info"><h1 class="title">Application wide locale</h1></div>
        

        <p class="para">
            Zend Framework allows the usage of an application wide locale. You simply set an
            instance of <span class="classname">Zend_Locale</span> to the registry with the key
            &#039;Zend_Locale&#039;. Then this instance will be used within all locale aware classes of
            Zend Framework. This way you set one locale within your registry and then you can forget
            about setting it again. It will automatically be used in all other classes. See the
            below example for the right usage:
        </p>

        <div class="example" id="zend.locale.frameworkwidelocale.example"><div class="info"><p><b>Example #9 Usage of an application wide locale</b></p></div>
            

            <pre class="programlisting brush: php">
// within your bootstrap
$locale = new Zend_Locale(&#039;de_AT&#039;);
Zend_Registry::set(&#039;Zend_Locale&#039;, $locale);

// within your model or controller
$date = new Zend_Date();
// print $date-&gt;getLocale();
echo $date-&gt;getDate();
</pre>

        </div>
    </div>

    <div class="section" id="zend.locale.formatoptions"><div class="info"><h1 class="title">Zend_Locale_Format::setOptions(array $options)</h1></div>
        

        <p class="para">
            The &#039;precision&#039; option of a value is used to truncate or stretch extra digits. A value
            of &#039;-1&#039; disables modification of the number of digits in the fractional part of the
            value. The &#039;locale&#039; option helps when parsing numbers and dates using separators and
            month names. The date format &#039;format_type&#039; option selects between
            <acronym class="acronym">CLDR</acronym>/ISO date format specifier tokens and <acronym class="acronym">PHP</acronym>&#039;s
            date() tokens. The &#039;fix_date&#039; option enables or disables heuristics that attempt to
            correct invalid dates. The &#039;number_format&#039; option specifies a default number format for
            use with  <span class="methodname">toNumber()</span> (see <a href="zend.locale.parsing.html#zend.locale.number.localize" class="link">this section</a>).
        </p>

        <p class="para">
            The &#039;date_format&#039; option can be used to specify a default date format string, but beware
            of using getDate(), checkdateFormat() and getTime() after using setOptions() with a
            &#039;date_format&#039;. To use these four methods with the default date format for a locale, use
            array(&#039;date_format&#039; =&gt; null, &#039;locale&#039; =&gt; $locale) for their options.
        </p>

        <div class="example" id="zend.locale.formatoptions.example-1"><div class="info"><p><b>Example #10 Dates default to correct locale of web users</b></p></div>
            

            <pre class="programlisting brush: php">
Zend_Locale_Format::setOptions(array(&#039;locale&#039; =&gt; &#039;en_US&#039;,
                                     &#039;fix_date&#039; =&gt; true,
                                     &#039;format_type&#039; =&gt; &#039;php&#039;));
</pre>

        </div>

        <p class="para">
            For working with the standard definitions of a locale the option
            <b><tt>Zend_Locale_Format::STANDARD</tt></b> can be used. Setting the option
            <b><tt>Zend_Locale_Format::STANDARD</tt></b> for <span class="property">date_format</span>
            uses the standard definitions from the actual set locale. Setting it for
            <span class="property">number_format</span> uses the standard number format for this locale.
            And setting it for locale uses the standard locale for this environment or browser.
        </p>

        <div class="example" id="zend.locale.formatoptions.example-2"><div class="info"><p><b>Example #11 Using STANDARD definitions for setOptions()</b></p></div>
            

            <pre class="programlisting brush: php">
Zend_Locale_Format::setOptions(array(&#039;locale&#039; =&gt; &#039;en_US&#039;,
                                     &#039;date_format&#039; =&gt; &#039;dd.MMMM.YYYY&#039;));
// overriding the global set date format
$date = Zend_Locale_Format::getDate(&#039;2007-04-20&#039;,
                                    array(&#039;date_format&#039; =&gt;
                                              Zend_Locale_Format::STANDARD);

// global setting of the standard locale
Zend_Locale_Format::setOptions(array(&#039;locale&#039; =&gt; Zend_Locale_Format::STANDARD,
                                     &#039;date_format&#039; =&gt; &#039;dd.MMMM.YYYY&#039;));
</pre>

        </div>
    </div>

    <div class="section" id="zend.locale.cache"><div class="info"><h1 class="title">Speed up Zend_Locale and its subclasses</h1></div>
        

        <p class="para">
            <span class="classname">Zend_Locale</span> and its subclasses can be speeded up by the usage of
            <span class="classname">Zend_Cache</span>. Use the static method
             <span class="methodname">Zend_Locale::setCache($cache)</span> if you are using
            <span class="classname">Zend_Locale</span>. <span class="classname">Zend_Locale_Format</span> can be
            speeded up the using the option <span class="property">cache</span> within
            <span class="classname">Zend_Locale_Format::setOptions(array(&#039;cache&#039; =&gt; $adapter));</span>.
            If you are using both classes you should only set the cache for
            <span class="classname">Zend_Locale</span>, otherwise the last set cache will overwrite the
            previous set cache. For convenience there are also the static methods
             <span class="methodname">getCache()</span>,  <span class="methodname">hasCache()</span>,
             <span class="methodname">clearCache()</span> and  <span class="methodname">removeCache()</span>.
        </p>

        <p class="para">
            When no cache is set, then <span class="classname">Zend_Locale</span> will automatically set a
            cache itself. Sometimes it is wished to prevent that a cache is set, even if this
            degrades performance. In this case the static
             <span class="methodname">disableCache(true)</span> method should be used. It does not only
            disable the actual set cache, without erasing it, but also prevents that a cache is
            automatically generated when no cache is set.
        </p>
    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.locale.html">Zend_Locale</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.locale.html">Zend_Locale</a></span><br />
                        <span class="home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.locale.functions.html">Using Zend_Locale</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></li>
  <li class="header up"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></li>
  <li class="header up"><a href="reference.html">Refer&ecirc;ncia do Zend Framework</a></li>
  <li class="header up"><a href="zend.locale.html">Zend_Locale</a></li>
  <li class="active"><a href="zend.locale.introduction.html">Introduction</a></li>
  <li><a href="zend.locale.functions.html">Using Zend_Locale</a></li>
  <li><a href="zend.locale.parsing.html">Normalization and Localization</a></li>
  <li><a href="zend.locale.date.datesandtimes.html">Working with Dates and Times</a></li>
  <li><a href="zend.locale.appendix.html">Supported locales</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>